/**
 * 撤销与重做需要用的数组
 */
!function(win){
    "use strict";
    var ArrayStack = function(){
        this.arr=[];
    }
    ArrayStack.prototype={
        constructor:ArrayStack,
        //压栈操作
        push:function(element){
            this.arr.push(element);
        },
        //退栈操作
        pop:function(){
            return this.arr.pop();
        },

        //获取栈顶元素
        top:function(){
            return this.arr[this.arr.length-1];
        },
        //获取栈长
        size:function(){
            return this.arr.length;
        },
        //获取第一个元素
        shift:function(){
            return this.arr.shift();
        },

        //清空栈

        clear:function(){
            this.arr = [];
            return true;
        },

        toString :function(){
            return this.arr.toString();
        },
    }
    win.ArrayStack = ArrayStack;
}(window);
